package me.shibor.java.spring.mvc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

@Controller
@RequestMapping("/hello")
public class HelloMvcController {

    
    @RequestMapping("/mvc")
    public String helloMvc() {
        return "home";
    }
    
    
    
    @RequestMapping("/file")
    public String fileUpload() {
        return "fileUpload";
    }
    
    @RequestMapping("/upLoad")
    public String upLoad(MultipartFile file) {

        String name = file.getName();
        System.out.println("file name: " + name);
        return "home";
    }
    
    @RequestMapping("/json")
    @ResponseBody
    public Boolean json() {
        
        return true;
    }
    
}
